let mix = require('laravel-mix');
let webpack = require('webpack');

function resolve (dir) {
  return path.join(__dirname, dir)
}


/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */


mix.js('resources/assets/js/app.js', 'public/js')
    .extract(['jquery', 'vue', 'vue-router', 'vee-validate', 'vue-echarts']);

mix.styles([
    'resources/assets/css/common.css',
    'resources/assets/css/app.css',
    // 'vendor/bright-tech/inspinia-admin/Static_Full_Version/css/plugins/chosen/bootstrap-chosen.css',
    'node_modules/animate.css/animate.css',
    'node_modules/pace-progress/themes/green/pace-theme-minimal.css',
    'node_modules/element-ui/lib/theme-default/index.css',
    'node_modules/bootstrap/dist/css/bootstrap.css',
    'node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css',
    'node_modules/vue2-lazy-tree/dist/vue2-tree.min.css',
], 'public/css/vendor.css');
mix.styles([
    'node_modules/vue-event-calendar/dist/style.css'],'public/css/calendar.css'
);
mix.sass('resources/assets/sass/app.scss', 'public/css');

mix.webpackConfig({
  output: {
    publicPath: "/",
    chunkFilename: './js/bundles/[name].js',
  },
  resolve: {
    alias: {
      'assets': resolve('resources/assets'),
    }
  },
  plugins: [
    new webpack.ProvidePlugin({
      $: 'jquery',
      jQuery: 'jquery',
      Popper: ['popper.js', 'default']
    })
  ]

});
mix.browserSync({
  proxy: 'pro.com'
})
